{% extends 'common/userpublic.html' %}
{% load static %}
{% block header %}
    安全设置
{% endblock %}

{% block body %}
    <div style="height: 49px;"></div>
    <ul class="safty">
        <li>
            <a href="{% url 'user:修改登录密码' %}">
                <img src="{% static 'images/update.png' %}" width="40"/>
                <i>修改登录密码</i>
                <span class="am-icon-angle-right"></span>
            </a>
        </li>
        <li>
            <a href="{% url 'user:支付密码' %}">
                <img src="{% static 'images/moneysafty.png' %}" width="40"/>
                <i>设置支付密码</i>
                <span class="am-icon-angle-right"></span>
            </a>
        </li>
        <li>
            <a href="{% url 'user:绑定新手机号' %}">
                <img src="{% static 'images/moneytele.png' %}" width="40"/>
                <i>绑定手机号</i>
                <span class="am-icon-angle-right"></span>
                <i style="float: right; padding-right: 10px;" id="phone">{{ phone }}</i>
            </a>
            <p style="overflow: hidden;">若你的手机已修改或信用，请立即更换</p>
        </li>
    </ul>
{% endblock %}

设置手机只显示前3后4位
{% block foot_js %}
    <script type="text/javascript">
        var phone = $('#phone').text();
        var newphone = '';
        if (phone.length > 0) {
            for (var i = 0; i < phone.length; i++) {
                if (i < 3 || i >= phone.length - 4) {
                    newphone += phone[i];
                } else {
                    newphone += '*';
                }
            }
        }
        $('#phone').text(newphone);
    </script>
{% endblock %}

